<div id ="student-list">
  <h1> Students listing</h1>

  <table cellpadding="10" cellspacing="1">
    <tr class="tableheader">
<th>Account</th>
<th>UserType</th>
<th>StudentId</th>
<th>Email</th>
<th>Sex</th>
<th>Telephone</th>
<th>MSN</th>
<th>Delete</th>
</tr>
    
  <% for user in @students %>
    <tr class="tablerecord">
    <td><%= link_to h(user.send("account")), :action => 'show_student', :id => user %></td>
    <td><%=h user.send("user_type")%></td>
    <td><%=h user.send("stuid") %></td>
    <td><%=h user.send("email") %></td>
    <td><%=h user.send("sex") %></td>
    <td><%=h user.send("tel") %></td>
    <td><%=h user.send("MSN") %></td>
    <td><%= link_to 'Delete', { :action  => 'delete_user', :id => user },
                                         :confirm => "Are you sure?",
                                         :method  => :post %></td>
      
    </tr>
  <% end %>
  </table>
<%= link_to 'Show Teachers', :action => 'list_teacher' %> | <%= link_to 'Show Students', :action => 'list_student' %>
</div>
<%= link_to 'Previous page', { :page => @student_pages.current.previous } if @student_pages.current.previous %>
<%= link_to 'Next page', { :page => @student_pages.current.next } if @student_pages.current.next %> 

